<template>
    <div>
        <h2>-----计数器组件-----</h2>
        <h2>{{count}}</h2>
        <button @click="count++">+</button>
        <button @click="count--">-</button>
    </div>
</template>

<script>
    const obj = {
        count: 0
    };
    export default {

        data(){
            return obj
        }
        /*data: {
                count: 0
        },*/
    };
</script>

<style scoped>

</style>
